package com.wisely.highlight_springmvc4;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;


/**
 * springmvc 配置
 * @author devin
 */
@Configuration
@EnableWebMvc  //会开启一些默认配置，如viewResolver 或者 MessageConverter
@ComponentScan(basePackages ="com.wisely.highlight_springmvc4.web")
public class MyMvcConfig {
		@Bean
		public InternalResourceViewResolver viewResolver(){
			InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
			viewResolver.setPrefix("/WEB-INF/classes/views/");
			viewResolver.setSuffix(".jsp");
			viewResolver.setViewClass(JstlView.class);
			return viewResolver;
			
		}
}
